package org.输入输出练习;

import java.util.Scanner;

/**
 * @Auther: qingle
 * @Date: 2024/8/19-2:56
 * @Description:
 * 给定一个n 行  m 列的二维正整数数组  a ，第i 行第  j 列元素的值为
 * ai,j 。请你求出数组元素之和。
 *
 * @version: 1.0
 */
public class PIO12_单组_二维字符数组 {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		scanner.nextLine();
		String[] strs = new String[n];
		for (int i = 0; i < n; i++) {
			String str = scanner.nextLine();
			strs[i] = str;
		}

		for (int i = n-1; i >= 0; i--) {
			System.out.println(new StringBuilder(strs[i]).reverse());
		}
	}
}
